﻿using System;
using System.Collections.Generic;
using System.Linq;
using NHibernate.Linq;
using System.Collections;
using log4net;
using log4net.Config;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
[assembly: log4net.Config.Repository()]

namespace celinda.Class
{
    public interface IBaseClasse
    {
        Int32 Id { get; set; }
        DateTime DateCreation { get; set; }
        DateTime DateModification { get; set; }
        Char Etat { get; set; }
    }

    public class Societe : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Nom { get; set; }
        public virtual String Adresse { get; set; }
        public virtual String CodePostal { get; set; }
        public virtual String Ville { get; set; }
        public virtual String Pays { get; set; }
        public virtual String Siret { get; set; }
        public virtual String RaisonSocial { get; set; }
        public virtual Double CapitalSocial { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual IList<Utilisateur> Utilisateurs { get; set; }
        public virtual IList<Fournisseur> Fournisseurs { get; set; }
        public virtual IList<Site> Sites { get; set; }
        public virtual IList<Client> Clients { get; set; }
    }

    public class Utilisateur : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Login { get; set; }
        public virtual String MotDePasse { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Societe Societe { get; set; }
    }

    public class Fournisseur : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Nom { get; set; }
        public virtual String Adresse { get; set; }
        public virtual String CodePostal { get; set; }
        public virtual String Ville { get; set; }
        public virtual String Pays { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Societe Societe { get; set; }
        public virtual IList<CommandeFournisseurTete> Commandes { get; set; }
    }

    public class Site : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Nom { get; set; }
        public virtual String Adresse { get; set; }
        public virtual String CodePostal { get; set; }
        public virtual String Ville { get; set; }
        public virtual String Pays { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Societe Societe { get; set; }
    }

    public class Genre : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Libelle { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
    }

    public class AdresseType : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Libelle { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
    }

    public class Client : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Nom { get; set; }
        public virtual String Prenom { get; set; }
        public virtual String NumeroFidelite { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Genre Genre { get; set; }
        public virtual Societe Societe { get; set; }
        public virtual IList<Adresse> Adresses { get; set; }
        public virtual IList<CommandeClientTete> Commandes { get; set; }

    }

    public class Adresse : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String AdresseLib { get; set; }
        public virtual String CodePostal { get; set; }
        public virtual String Ville { get; set; }
        public virtual String Pays { get; set; }
        public virtual String Telephone { get; set; }
        public virtual String Portable { get; set; }
        public virtual String Fax { get; set; }
        public virtual String Email { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual AdresseType AdresseType { get; set; }
        public virtual Client Client { get; set; }
    }

    public class Article : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual String Libelle { get; set; }
        public virtual String GendCod { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Fournisseur Fournisseur { get; set; }
    }

    public class CommandeClientTete : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual DateTime DateMouvement { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Adresse AdresseFacturation { get; set; }
        public virtual Adresse AdresseLivraison { get; set; }
        public virtual Client Client { get; set; }
        public virtual IList<CommandeClientLigne> Lignes { get; set; }
    }

    public class CommandeClientLigne : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual Int32 Quantite { get; set; }
        public virtual Double Prix { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual CommandeClientTete Commande { get; set; }
        public virtual Article Article { get; set; }
    }

    public class CommandeFournisseurTete : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual DateTime DateMouvement { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual Fournisseur Fournisseur { get; set; }
        public virtual Site Site { get; set; }
        public virtual IList<CommandeFournisseurLigne> Lignes { get; set; }
    }

    public class CommandeFournisseurLigne : IBaseClasse
    {
        public virtual Int32 Id { get; set; }
        public virtual Int32 Quantite { get; set; }
        public virtual Double Prix { get; set; }
        public virtual DateTime DateCreation { get; set; }
        public virtual DateTime DateModification { get; set; }
        public virtual Char Etat { get; set; }
        public virtual CommandeFournisseurTete Commande { get; set; }
        public virtual Article Article { get; set; }
    }

    public class Log
    {
        #region Data Members
        public static readonly ILog Logger = LogManager.GetLogger(Const.LoggerName);
        #endregion
    }
}
